package api.http.MeiZi.api;

import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

import java.util.List;

import api.base.bean.BasicResponse;
import api.base.impl.BaseImpl;
import api.base.observer.DefaultObserver;
import api.http.MeiZi.bean.MeiZi;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;


/**
 * Created by Administrator on 2018-01-11.
 */

public class MeiziImpl extends BaseImpl<MeiziService> implements IMeizi {

    @Override
    public void getMeizi(RxAppCompatActivity context, DefaultObserver<BasicResponse<List<MeiZi>>> observer) {
        mService.getMezi().subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .compose(context.<BasicResponse<List<MeiZi>>>bindToLifecycle())
                .subscribe(observer);
    }
}
